package com.sikaryofficial.workbench.constant;

import lombok.Getter;

/**
 * 商品上架状态
 */
@Getter
public enum GoodsListingStatusEnum {

    NO(0, "未上架"),
    YES(1, "已上架");

    private final Integer code;
    private final String desc;

    GoodsListingStatusEnum(final Integer code, final String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GoodsListingStatusEnum getByCode(Integer code) {
        for (GoodsListingStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
